/******************************************************************************
 * Copyright (C) 2015  671643387@qq.com
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 *****************************************************************************/

#ifndef SHARED_UTIL_OPTIONSET_H_
#define SHARED_UTIL_OPTIONSET_H_

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif

#include <string>
#include <vector>
#include "Shared/Global_Macros.h"
#include "Shared/Util/Option.h"


namespace Shared {
namespace Util {

    class OptionSet
    {
    public:
        typedef std::vector<Option>::iterator iterator;
        typedef std::vector<Option>::const_iterator const_iterator;

        OptionSet(void);
        ~OptionSet(void);

        iterator begin(void) {
            return _options.begin();
        }
        iterator end(void) {
            return _options.end();
        }
        const_iterator begin(void) const {
            return _options.begin();
        }
        const_iterator end(void) const {
            return _options.end();
        }

        void addOption(Option& option);
        void process(std::vector<std::string>& args);

    private:
        std::vector<Option> _options;
        DISALLOW_COPY_AND_ASSIGN(OptionSet);
    };

}}

#endif // SHARED_UTIL_OPTIONSET_H_
